<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>索引</title>
  <link href="../Styles/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  <h2 id="indexes">索引</h2>

  <p class="h2subheading">— 为您的书创建索引 —</p>

  <p>If you want to create an Index for your book, you can use Sigil to identify what to index and then to automatically create a new HTML page containing the index.</p>
  <p>如果要为书创建索引，则可以使用 Sigil 识别要索引的内容，然后自动创建一个包含索引的新 HTML 页面。</p>

  <p>You can mark individual words in your text for indexing, or use the Index Editor to make sure every occurrence of the word is indexed.</p>
  <p>您可以在文本中标记单个单词以进行索引，也可以使用“索引编辑器”来确保对每个出现的单词都进行索引。</p>

  <h3 class="sigil_not_in_toc">标记要索引的条目</h3>

  <p>The first way to identify entries to include in the index is to mark specific words or phrases in your text. Only the occurrence of the word or phrase you mark will be included in the Index – if you need all occurrences use the Index Editor.</p>
  <p>识别要包含在索引中的条目的第一种方法是标记文本中的特定单词或短语。索引中仅包含您标记的单词或短语——如果需要所有出现的单词或短语，请使用索引编辑器。</p>

  <p>Highlight a word or phrase in Code View and then select the menu item <span class="menuitem">Tools→Index→Mark For Index</span> or its keyboard shortcut (which you can change). This will then open a prompt for you to enter how you want these words to appear in the index:</p>
  <p>在“代码视图”中突出显示一个单词或短语，然后选择菜单项 <span class="menuitem">工具→索引→标记为索引</span> 或其键盘快捷键（可以更改）。然后，这将打开一个提示，提示您输入您希望这些单词出现在索引中的方式：</p>

  <div class="image">
    <img alt="index-mark" src="../Images/index-mark.png"/>
  </div>

  <p>The text you enter as the name to use in the Index will be show up in the Index as follows:</p>
  <p>输入的文本作为要在索引中使用的名称，将显示在索引中，如下所示：</p>

  <ul>
    <li><span class="listheading">[blank]:</span> If you leave the name empty, then the exact words you highlighted will be used in the index.</li>
    <li><span class="listheading">[blank]：</span>如果将名称保留为空，则突出显示的确切单词将用于索引。</li>

    <li><span class="listheading">words:</span> If you enter a word or phrase, then that word or phrase will be used (e.g. Oak instead of oak).</li>
    <li><span class="listheading">words：</span>如果输入单词或短语，则将使用该单词或短语（例如，用 Oak 代替 oak ）。</li>

    <li><span class="listheading">heading/words:</span> If you use a "/" in the name then a hierarchical group will be created (e.g. Forest/Tree/Oak will create an entry Oak filed under Tree filed under Forest).</li>
    <li><span class="listheading">heading/words：</span>如果您在名称中使用“/”，则将创建一个层次组（例如，Forest/Tree/Oak 将在 Oak 下的 Tree 下创建一个 Oak 条目）。</li>

    <li><span class="listheading">entrya;entryb:</span> If you use a ";" then multiple entries will be created for this word or phrase.</li>
    <li><span class="listheading">entrya;entryb：</span>如果使用“;” 然后将为此单词或短语创建多个条目。</li>
  </ul>

  <p>When you mark text for indexing, it just adds add some Sigil-specific HTML code that tells Sigil to include these words when you create the index. In code view it might appear as follows:</p>
  <p>当您将文本标记为索引时，它只会添加一些特定于 Sigil 的 HTML 代码，该代码告诉 Sigil 在创建索引时包括这些单词。 在代码视图中，它可能如下所示：</p>

  <pre class="example">&lt;a class="sigil_index_marker" title="Character/Alice"&gt;Alice&lt;/a&gt;
</pre>

  <p>If you no longer want a word or phrase to be indexed by Sigil, you will need to delete the special HTML tags around the word.</p>
  <p>如果您不再希望 Sigil 为某个词或短语建立索引，则需要删除该词周围的特殊 HTML 标记。</p>

  <div class="tip">
    <p class="tiptext">To find indexed words you can search in Code View. Or you can highlight them in Preview in color by adding the following CSS temporarily to your stylesheet:</p>
    <p class="tiptext">要查找索引词，可以在“代码视图”中搜索。或者，您可以通过将以下 CSS 临时添加到样式表中，以彩色预览突出显示它们：</p>

    <pre>[class="sigil_index_marker"] { color:#335500; }</pre>
  </div>

  <h3 class="sigil_not_in_toc">将条目添加到索引编辑器</h3>

  <p>The second way identify words to index is to add the words to a list. Then when you create the index every occurrence of that word will be included in the index automatically. You can use words marked for indexing and a list of words to index at the same time.</p>
  <p>识别要索引的单词的第二种方法是将单词添加到列表中。然后，当您创建索引时，该单词的每次出现都会自动包含在索引中。您可以同时使用标记为索引的单词和要索引的单词列表。</p>

  <p>To add specific words to the index list, highlight the word or phrase, and then select the menu item <span class="menuitem">Tools→Index→Add To Index Editor</span>. If your selected text includes any HTML tags, you should remove them.</p>
  <p>要将特定单词添加到索引列表，请突出显示单词或短语，然后选择菜单项 <span class="menuitem">工具→索引→添加到索引编辑器</span>。如果所选文本包含任何 HTML 标记，则应将其删除。</p>

  <p>This will bring up the Index Editor with the word added to the list of entries to index. You can also enter words directly in the Index Editor as described below.</p>
  <p>这将打开索引编辑器，并将单词添加到要索引的条目列表中。您还可以如下所述直接在“索引编辑器”中输入单词。</p>

  <h3 class="sigil_not_in_toc">创建索引</h3>

  <p>To actually create your index once you have marked words and/or added them to the list just select the menu item <span class="menuitem">Tools→Index→Create Index</span>.</p>
  <p>要在标记了单词 and/or 将单词添加到列表后真正创建索引，只需选择菜单项 <span class="menuitem">工具→索引→创建索引</span>。</p>

  <p>This will create or update an HTML page called i<span class="shortcut">ndex.xhtml</span>. It will be marked with the semantic type "index". Entries are listed alphabetically, and, using the default styling, look like this:</p>
  <p>这将创建或更新一个名为 <span class="shortcut">index.xhtml</span> 的 HTML 页面。它将被标记为语义类型“索引”。条目按字母顺序列出，并使用默认样式，如下所示：</p>

  <div class="image">
    <img alt="index-html" src="../Images/index-html.png"/>
  </div>

  <div class="tip">
    <p class="tiptext">You can edit the index page as with any HTML page, but if you re-create the index your changes will be over-written.</p>
    <p class="tiptext">您可以像编辑任何 HTML 页面一样编辑索引页面，但是如果重新创建索引，则更改将被覆盖。</p>
  </div>

  <h4 class="sigil_not_in_toc">自定义索引样式表</h4>

  <p>The index page uses a separate CSS file (<span class="example">sgc-index.css</span>) to format the index. If the file already exists in your book it will not be overwritten (so you can customise it without losing your changes). But if it does not exist, it will look for <span class="example">sgc-index.css</span> in your preferences directory and use that as the default file. If there is no file in your preferences directory, then Sigil will create a default stylesheet for the index.</p>
  <p>索引页面使用单独的 CSS 文件（<span class="example">sgc-index.css</span>）格式化索引。如果文件已经存在于您的书中，则不会被覆盖（因此您可以自定义它而不会丢失所做的更改）。但是，如果它不存在，它将在您的首选项目录中查找 <span class="example">sgc-index.css</span> 并将其用作默认文件。如果您的首选项目录中没有文件，则 Sigil 将为索引创建默认样式表。</p>

  <h3 class="sigil_not_in_toc">索引编辑器</h3>

  <p>The Index Editor is used to manage the list of entries that will be included in the index. It does not include the words you marked for indexing – they are included automatically.</p>
  <p>索引编辑器用于管理将包含在索引中的条目列表。它不包括您标记为要索引的单词 - 它们会自动包含在内。</p>

  <p>To open the Index Editor select the menu item <span class="menuitem">Tools→Index→Index Editor</span> or its keyboard shortcut:</p>
  <p>要打开索引编辑器，请选择菜单项 <span class="menuitem">工具→索引→索引编辑器</span> 或其键盘快捷键：</p>

  <div class="image">
    <img alt="index-editor" src="../Images/index-editor.png"/>
  </div>

  <h4 class="sigil_not_in_toc">要包含的文本</h4>

  <p>The "Text To Include" column is a list of patterns you want Sigil to search for in your text and then to create an Index entry for using the format in the "Index Entries" column. Entries in the "Text To Include" column can use the following formats:</p>
  <p>“要包含的文本”列是希望 Sigil 在文本中搜索然后创建索引条目以使用“索引条目”列中的格式的模式的列表。“要包含的文本”列中的条目可以使用以下格式：</p>

  <ul>
    <li><span class="listheading">单词：</span> The words in the book must exactly match the listed words (case-sensitive). Do not include any HTML tags, just the words as they appear in Preview.</li>
    <li><span class="listheading">words：</span>本书中的单词必须与列出的单词完全匹配（区分大小写）。不要包括任何 HTML 标记，仅包括在预览中显示的单词。</li>

    <li><span class="listheading">Regex:</span> You can enter most regex patterns - they will be match on a paragraph by paragraph basis. For example, to match words while ignoring case sensitivity you can use "<span class="example">[Gg]utenberg</span>" or "<span class="example">(?i)Gutenberg</span>".</li>
    <li><span class="listheading">正则表达式：</span>您可以输入大多数正则表达式模式 - 它们将逐段匹配。例如，要在忽略大小写区分的同时匹配单词，可以使用“ <span class="example">[Gg]utenberg</span>”或“<span class="example">(?i)Gutenberg</span>”。</li>
  </ul>

  <div class="tip">
    <p class="tiptext">You can paste text into the Text To Include field – e.g. from a file containing a list of words – and the text will be automatically split into separate entries for each line.</p>
    <p class="tiptext">您可以将文本粘贴到“要包含的文本”字段中，例如，从包含单词列表的文件中删除 - 文本将自动分为每行单独的条目。</p>

    <p class="tiptext">You can also use Open to open a text file of words (and entries separated by tabs).</p>
    <p class="tiptext">您也可以使用“打开”打开单词（以及由制表符分隔的条目）的文本文件。</p>
  </div>

  <h4 class="sigil_not_in_toc">索引条目</h4>

  <p>The "Index Entries" column is what will actually appear in the Index for words matching the "Text To Include" column.</p>
  <p>“索引条目”列实际上是与“包含的文本”列匹配的单词在索引中实际显示的内容。</p>

  <p>Entries in the "Index Entries" column can use the following formats:</p>
  <p>“索引条目”列中的条目可以使用以下格式：</p>

  <ul>
    <li><span class="listheading">blank:</span> If you leave the entry blank, then the words entered in the Text to Include column will be used for the entry’s name.</li>
    <li><span class="listheading">blank：</span>如果您将条目保留为空白，则在“要包含的文本”列中输入的单词将用作条目的名称。</li>

    <li><span class="listheading">words:</span> If you enter a word or phrase, then that word or phrase will be used (e.g. Oak instead of oak).</li>
    <li><span class="listheading">words：</span>如果输入单词或短语，则将使用该单词或短语（例如，用 Oak 代替 oak）。</li>

    <li><span class="listheading">heading/words:</span> If you use a "/" in your name then a hierarchical group will be created (e.g. Forest/Tree/Oak will create an entry Oak filed under Tree filed under Forest).</li>
    <li><span class="listheading">heading/words：</span>如果您在名称中使用“/”，则会创建一个层次组（例如，Forest/Tree/Oak 将在 Oak 下的 Tree 下创建一个 Oak 条目）。</li>

    <li><span class="listheading">heading/:</span> If you use a "/" at the end of the entry name, then a hierarchical group will be created and the words in the Text to Include column will be used as a sub-entry.</li>
    <li><span class="listheading">heading/：</span>如果您在条目名称的末尾使用“/”，则将创建一个层次组，并且“要包含的文本”列中的单词将用作子条目。</li>
  </ul>

  <h4 class="sigil_not_in_toc">上下文菜单</h4>

  <p>Most actions concerning editing clips can be done by using the context menu.</p>
  <p>与剪辑有关的大多数操作都可以通过使用上下文菜单来完成。</p>

  <p>Select one or more entries then right-click on the selection for the following options:</p>
  <p>选择一个或多个条目，然后右键单击所选内容以选择以下选项：</p>

  <ul>
    <li><span class="listheading">Add Entry:</span> Add a blank search under the entry you clicked.</li>
    <li><span class="listheading">添加条目：</span>在您单击的条目下添加空白搜索。</li>

    <li class="first"><span class="listheading">Edit:</span> Edit the entry.</li>
    <li class="first"><span class="listheading">编辑：</span>编辑条目。</li>

    <li class="first"><span class="listheading">Cut:</span> Delete one or more entries that can be pasted later.</li>
    <li class="first"><span class="listheading">剪切：</span>删除一个或多个以后可以粘贴的条目。</li>

    <li><span class="listheading">Copy:</span> Copy one or more entries that can be pasted later.</li>
    <li><span class="listheading">复制：</span>复制一个或多个以后可以粘贴的条目。</li>

    <li><span class="listheading">Paste:</span> Paste any cut/copied entries.</li>
    <li><span class="listheading">粘贴：</span>粘贴所有剪切/复制的条目。</li>

    <li class="first"><span class="listheading">Delete:</span> Delete entries.</li>
    <li class="first"><span class="listheading">删除：</span>删除条目。</li>

    <li class="first"><span class="listheading">Open:</span> Replace the current Index List with entries from a file (either an index file or a text file).</li>
    <li class="first"><span class="listheading">打开：</span>用文件（索引文件或文本文件）中的条目替换当前的索引列表。</li>

    <li><span class="listheading">Reload:</span> Restore the list from the last saved state.</li>
    <li><span class="listheading">重新加载：</span>从上次保存的状态恢复列表。</li>

    <li class="first"><span class="listheading">Save As:</span> Save all entries to a file for keeping a per-book list of index entries.</li>
    <li class="first"><span class="listheading">另存为：</span>将所有条目保存到文件中，以保留每本书的索引条目列表。</li>

    <li class="first"><span class="listheading">Autofill:</span> Fill the list with every word in the book.</li>
    <li class="first"><span class="listheading">自动填充：</span>用书中的每个单词填充列表。</li>

    <li class="first"><span class="listheading">Select All:</span> Select all entries (for easy deletion).</li>
    <li class="first"><span class="listheading">全选：</span>选择所有条目（以方便删除）。</li>
  </ul>

  <h4 class="sigil_not_in_toc">保存</h4>

  <p>To save your entries to disk, click <span class="buttonbox">Save</span>.</p>
  <p>要将条目保存到磁盘，请单击 <span class="buttonbox">保存</span>。</p>

  <p>To exit without saving your entries you can just close the window (with the close button or the <span class="shortcut">Esc</span> key). You can also use the context menu <span class="menuitem">Reload</span> to reload your entries from disk – which will delete your current entries.</p>
  <p>要退出而不保存输入，只需关闭窗口即可（使用关闭按钮或 <span class="shortcut">Esc</span> 键）。您还可以使用上下文菜单 <span class="menuitem">重新加载</span> 从磁盘重新加载条目 - 这将删除当前条目。</p>

  <div class="tip">
    <p class="tiptext">If you save and are running more than one copy of Sigil, then the other instances of Sigil will automatically reload the newly saved index entries to keep all copies in sync.</p>
    <p class="tiptext">如果您保存并运行多个 Sigil 副本，则 Sigil 的其他实例将自动重新加载新保存的索引条目，以使所有副本保持同步。</p>
  </div>

  <h4 class="sigil_not_in_toc">过滤</h4>

  <p>You can use the filter text box to restrict the list of searches shown to make it easier to find a search.</p>
  <p>您可以使用过滤器文本框来限制显示的搜索列表，以使查找更加容易。</p>

  <h4 class="sigil_not_in_toc">打开或导入文本文件</h4>

  <p>The <span class="menuitem">Open</span> context menu item can be used to open saved Index files, but it can also open text files.</p>
  <p>The <span class="menuitem">打开</span>上下文菜单项可用于打开保存的索引文件，但也可以打开文本文件。</p>

  <p>You can list just the Text To Include words in the text file – one per line. Or you can include both the Text To Include and Index Entry values by separating them with a tab – one per line.</p>
  <p>您可以只列出要在文本文件中包含单词的文本 - 每行一个。或者，您可以通过使用制表符（每行一个）将它们分开来同时包含要包含的文本值和索引条目值。</p>
</body>
</html>